﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ZLDC.Common.Estate;
using System.Data;

namespace ZLDC.Topo.BLL.Estate
{
    public  class TranLogBLL
    {
        public static string p_tran_log_insert(int user_id, string user_name, int user_from, string user_from_name, int user_to, string user_to_name, string opr_type, string sqlText)
        {
            string outmsg = "";
            int newid = 0;
            string ip = _Tools.GetIp();
            int operateUserId = _Convert.ToInt(_Utility.GetInfoBySession().m_sUserID, 0);
            string operateUser = _Utility.GetInfoBySession().m_sUserName;

            using (_Database db = new _Database("estate"))
            {
                ZLDC.DAL.Estate.TranLogDAL.p_tran_log_insert(user_id, user_name, user_from, user_from_name, user_to, user_to_name, opr_type, sqlText, out outmsg, out newid, db);
            }

            return outmsg;
        }
        public static string p_tran_log_list_table(int page, int pagesize, string condition)
        {
            DataTable dt = null;
            int total = 0;
            int pageall = 0;
            using (_Database db = new _Database("estate"))
            {
                dt = ZLDC.DAL.Estate.TranLogDAL.p_tran_log_list_table(page, pagesize, condition, ref total, db);
            }
            pageall = _Utility.GetPageAll(pagesize, total);                  _Json json = new _Json(dt, 1);
            return "{page:{currentpage:'" + page + "',pagesize:'" + pagesize + "',total:'" + total + "',pageall:'" + pageall + "'},record:" + json.ToJson() + "}";

        }
    }
}
